@extends('huweize.layouts.userHome')
@section('title','作家资料-阅文作家专区')
@section('main')
    @if(count($errors))
        <script>
            alert('{!! $errors->first('qq'),$errors->first('tel'),$errors->first('email'),$errors->first('newaddress'),$errors->first('icon'),$errors->first('age')!!}')
        </script>
    @endif
    <div class="col-md-12 vipHeader">
        <h3>作家资料</h3>
    </div>
    {{--选项卡--}}
    <div class="bs-example bs-example-tabs" data-example-id="togglable-tabs">
        <ul id="myTabs" class="nav nav-tabs" role="tablist">
            <li role="presentation" class="active"><a href="#home" id="home-tab" role="tab" data-toggle="tab" aria-controls="home" aria-expanded="true">基础信息</a></li>
            <li role="presentation"><a href="#profile" role="tab" id="profile-tab" data-toggle="tab" aria-controls="profile">详细信息</a></li>

        </ul>
        <div id="myTabContent" class="tab-content">
            {{--基础信息--}}
            <div role="tabpanel" class="tab-pane fade in active" id="home" aria-labelledby="home-tab">
                <div class="col-md-12 vipList">
                    <ul>
                        &nbsp;
                        <li class="userIcon">
                            <em>头像</em>
                            @if($userList->icon)
                                <img src="{{asset('image/writer/'.$userList->icon)}}" alt="" style="height:64px;width:64px">
                            @else
                                <img src="{{asset('image/public.jpg')}}" alt="" style="height:64px;width:64px">
                            @endif
                        </li>

                        <li>
                            <em>笔名</em>
                            <span>{{$userList->nickname}}</span>
                        </li>
                        <li>
                            <em>性别</em>
                            <span>
                                 @if($userList->sex == 1)
                                    男
                                @elseif($userList->sex == 2)
                                    女
                                @elseif($userList->sex == 3)
                                    保密
                                @endif
                             </span>
                        </li>

                        <li>
                            <em>手机号码</em>
                            <span>{{$userList->tel}}</span>
                        </li>
                        <li>
                            <em>电子邮箱</em>
                            <span>{{$userList->email}}</span>
                        </li>
                        <li>
                            <em>QQ号</em>
                            <span>{{$userList->qq}}</span>
                        </li>
                        <li>
                            <em>详细地区</em>
                            <span>{{$userList->newaddress}}</span>
                        </li>
                    </ul>
                    <p class="VIPChange">
                        <button type="button" class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal">修改</button>
                    </p>
                </div>
            </div>
            {{--详细信息--}}
            <div role="tabpanel" class="tab-pane fade" id="profile" aria-labelledby="profile-tab">
                <div class="col-md-12 vipList">
                    <ul>
                        @if(count($List))

                            @foreach($List as $k)
                                <li>
                                    <em>真实姓名</em>
                                    <span>
                                 @if($k->name)
                                            {{$k->name}}
                                        @else
                                            暂无数据
                                        @endif
                             </span>
                                </li>
                                <li>
                                    <em>年龄</em>
                                    <span>
                                @if($k->name)
                                            {{$k->age}}
                                        @else
                                            暂无数据
                                        @endif
                            </span>
                                </li>
                                <li>
                                    <em>职业</em>
                                    <span>
                                @if($k->job)
                                            {{$k->job}}
                                        @else
                                            暂无数据
                                        @endif
                            </span>
                                </li>
                                <li>
                                    <em>学历</em>
                                    <span>
                                @if($k->record)
                                            {{$k->record}}
                                        @else
                                            暂无数据
                                        @endif
                            </span>
                                </li>
                                <li>
                                    <em>毕业院校</em>
                                    <span>
                                @if($k->school)
                                            {{$k->school}}
                                        @else
                                            暂无数据
                                        @endif
                            </span>
                                </li>
                                <li>
                                    <em>专业</em>
                                    <span>
                                @if($k->discipline)
                                            {{$k->discipline}}
                                        @else
                                            暂无数据
                                        @endif
                            </span>
                                </li>
                            @endforeach
                        @else
                            <li>
                                <em>真实姓名</em>
                                <span>暂无数据</span>
                            </li>
                            <li>
                                <em>年龄</em>
                                <span>暂无数据</span>
                            </li>
                            <li>
                                <em>职业</em>
                                <span>暂无数据</span>
                            </li>
                            <li>
                                <em>学历</em>
                                <span>暂无数据</span>
                            </li>
                            <li>
                                <em>毕业院校</em>
                                <span>暂无数据</span>
                            </li>
                            <li>
                                <em>专业</em>
                                <span>暂无数据</span>
                            </li>
                        @endif
                    </ul>
                    <p class="VIPChange">
                        <button class="btn btn-primary btn-lg" data-toggle="modal" data-target="#myModal-two">
                            修改
                        </button>
                    </p>
                </div>
            </div>
        </div>
    </div>

    {{--基础信息模态框--}}
    <div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h3 class="modal-title" id="myModalLabel">基础资料</h3>
                </div>
                <div class="modal-body">
                    <form action="{{url('huweize/home/userVIP/'.$userList->id)}}" method="post" enctype="multipart/form-data">
                        {{csrf_field()}}
                        <div class="form-group">
                            <h4>头像:</h4>
                            <input type="file" class="form-control" name="icon">
                        </div>
                        <div class="form-group">
                            <h4>笔名:</h4>
                            <input type="text" class="form-control" value="{{$userList->nickname}}" name="nickname">
                        </div>
                        <div class="form-group">
                            <h4>性别:</h4>
                            <label><input type="radio" name="sex" value="1"  <?=$userList->sex==1?'checked':'' ?>>男</label>
                            <label><input type="radio" name="sex" value="2" <?=$userList->sex==2?'checked':'' ?>>女</label>
                            <label><input type="radio" name="sex" value="3" <?=$userList->sex==3?'checked':'' ?>>保密</label>
                        </div>
                        <div class="form-group">
                            <h4>手机号码:</h4>
                            <input type="text" class="form-control" value="{{$userList->tel}}" name="tel">
                        </div>
                        <div class="form-group">
                            <h4>邮箱:</h4>
                            <input type="email" class="form-control" value="{{$userList->email}}" name="email">
                        </div>
                        <div class="form-group">
                            <h4>QQ号:</h4>
                            <input type="text" class="form-control" value="{{$userList->qq}}" name="qq">
                        </div>
           
                        <div class="form-group">
                            <h4>详细地址:</h4>
                            <input type="text" class="form-control" value="{{$userList->newaddress}}" name="newaddress">
                        </div>
                        <input type="submit" class="btn btn-primary" value="提交">
                    </form>
                </div>
                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
                </div>
            </div>
        </div>
    </div>


    <!-- 详细信息模态框 -->
    <div class="modal fade" id="myModal-two" tabindex="-1" role="dialog" aria-labelledby="myModalLabel">
        <div class="modal-dialog" role="document">
            <div class="modal-content">
                <div class="modal-header">
                    <button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">&times;</span></button>
                    <h3 class="modal-title" id="myModalLabel">详细信息</h3>
                </div>

                @if(count($List))
                    @foreach($List as $k)
                        <div class="modal-body">
                            <form action="{{url('/huweize/home/userVIPP/'.$k->id)}}" method="post">
                                {{csrf_field()}}
                                <input type="hidden" value="{{$k->wid}}" name="wid">
                                <div class="form-group">
                                    <h4>真实姓名:</h4>
                                    @if($k->name)
                                        <input type="text" class="form-control" value="{{$k->name}}" name="name">
                                    @else
                                        <input type="text" class="form-control" value="暂无数据" name="name">
                                    @endif
                                </div>
                                <div class="form-group">
                                    <h4>年龄:</h4>
                                    @if($k->age)
                                        <input type="text" class="form-control" value="{{$k->age}}" name="age">
                                    @else
                                        <input type="text" class="form-control" value="0" name="age">
                                    @endif
                                </div>
                                <div class="form-group">
                                    <h4>职业:</h4>
                                    @if($k->job)
                                        <input type="text" class="form-control" value="{{$k->job}}" name="job">
                                    @else
                                        <input type="text" class="form-control" value="暂无数据" name="job">

                                    @endif
                                </div>
                                <div class="form-group">
                                    <h4>学历:</h4>
                                    @if($k->record)
                                        <input type="text" class="form-control" value="{{$k->record}}" name="record">
                                    @else
                                        <input type="text" class="form-control" value="暂无数据" name="record">
                                    @endif
                                </div>
                                <div class="form-group">
                                    <h4>毕业院校:</h4>
                                    @if($k->school)
                                        <input type="text" class="form-control" value="{{$k->school}}" name="school">
                                    @else
                                        <input type="text" class="form-control" value="暂无数据" name="school">
                                    @endif
                                </div>
                                <div class="form-group">
                                    <h4>专业:</h4>
                                    @if($k->discipline)
                                        <input type="text" class="form-control" value="{{$k->discipline}}" name="discipline">
                                    @else
                                        <input type="text" class="form-control" value="暂无数据" name="discipline">
                                    @endif
                                </div>
                                <input type="submit" class="btn btn-primary" value="提交">
                            </form>
                        </div>
                    @endforeach
                @else
                    <div class="modal-body">
                        <form action="{{url('/huweize/home/userVIPP/'.$id)}}" method="post">
                            {{csrf_field()}}
                            <div class="form-group">
                                <h4>真实姓名:</h4>
                                <input type="text" class="form-control" value="暂无数据" name="name">
                            </div>
                            <div class="form-group">
                                <h4>年龄:</h4>
                                <input type="text" class="form-control" value="0" name="age">
                            </div>
                            <div class="form-group">
                                <h4>职业:</h4>
                                <input type="text" class="form-control" value="暂无数据" name="job">
                            </div>
                            <div class="form-group">
                                <h4>学历:</h4>
                                <input type="text" class="form-control" value="暂无数据" name="record">
                            </div>
                            <div class="form-group">
                                <h4>毕业院校:</h4>
                                <input type="text" class="form-control" value="暂无数据" name="school">
                            </div>
                            <div class="form-group">
                                <h4>专业:</h4>
                                <input type="text" class="form-control" value="暂无数据" name="discipline">
                            </div>
                            <input type="submit" class="btn btn-primary" value="提交">
                        </form>
                    </div>
                @endif

                <div class="modal-footer">
                    <button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>

                </div>
            </div>
        </div>
    </div>
@endsection
